Units of duration in QTP7
I am using AppleScript to play audio through QTP7, employing the following key lines:
tell application "QuickTime Player 7" to play document 1
repeat
display dialog "Interrupt" buttons {"Stop", "Pause"} giving up after my secLeft()
--etc
endrepeat
on secLeft()
tell application "QuickTime Player 7"
tell document 1
set d to (duration - current time)
end tell
end tell
--set d to round d * 0.00166 rounding down -- library pop music
--setdtoroundd * 0.00002268 roundingdown -- library classical music
return d
end secLeft
Display dialog disappears after a number of seconds set by secLeft().
One would suppose, that duration and current time are given in seconds too, but that is not the case, so I have to correct d to express it in seconds.
I have two iTunes libraries with each a different correction factor; within a library the correction factor is the same for each song, at least I hope so, and until now that seems to be the case.
Until recently duration and current time were expressed in seconds in QTP, but after updating to Mountain Lion I ran into problems; the switch to QTP7 could also be the culprit.
My questions:
1. Why are duration and current time not simply expressed in seconds?
2. More importantly, what determines the correction factor and what can I expect for my next iTunes library?
Maybe I should address these questions to the designers of AppleScript of QTP7, but where?
iMac, OS X Mountain Lion (10.8.2), FileMaker Pro 11